package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SettleOrderSource;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Created by DK on 16/11/9.
 * 结算
 */
@Entity
@Table(name = "settlement_record")
@DynamicInsert
@DynamicUpdate
public class SettlementRecord extends IDEntityMall {

    @Column(columnDefinition = "bigint comment'平台ID'")
    private Long mallId;

    @Column(columnDefinition = "bigint comment'商家ID'")
    private Long merchantId;

    @Column(columnDefinition = "bigint comment'购买者ID'")
    private Long buyerId;

    @Column(columnDefinition = "bigint comment'分享者ID'")
    private Long sharerId;

    @Column(columnDefinition = "bigint comment'产品ID'")
    private Long productId;

    @Column(columnDefinition = "varchar(100) comment'平台订单号'")
    private String mallOrderNum;

    @Column(columnDefinition = "varchar(100) comment'商家订单号'")
    private String merchantOrderNum;

    @Column(columnDefinition = "DECIMAL(30,10) comment'结算金额'")
    private BigDecimal settleAmount = BigDecimal.valueOf(0);

    @Column(columnDefinition = "DECIMAL(30,10) comment'平台服务费'")
    private BigDecimal serveFee = BigDecimal.valueOf(0);

    @Column(columnDefinition = "bigint comment'结算产品数量'")
    private Long settleNum;

    @Column(columnDefinition = "DECIMAL(30,10) comment'分销佣金'")
    private BigDecimal resellFee = BigDecimal.valueOf(0);

    @Column(columnDefinition = "DECIMAL(30,10) comment'分享者返利'")
    private BigDecimal sharerFee = BigDecimal.valueOf(0);

    @Column(columnDefinition = "DECIMAL(30,10) comment'购买者返利'")
    private BigDecimal buyerFee = BigDecimal.valueOf(0);

    @Column(columnDefinition = "varchar(100) comment'商家名称'")
    private String merchantName;

    @Column(columnDefinition = "varchar(100) comment'购买者名称'")
    private String buyerName;

    @Column(columnDefinition = "varchar(30) comment '结算订单来源 MARKET(\"实物商品\"), SELF(\"自由渠道\"), SHARE(\"粉丝分享\")'")
    @Enumerated(EnumType.STRING)
    private SettleOrderSource orderSource;

    @Column(columnDefinition = "bigint comment'资金流水ID'")
    private Long fundFlowId;

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public Long getMerchantId() {
        return merchantId;
    }

    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }

    public Long getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(Long buyerId) {
        this.buyerId = buyerId;
    }

    public Long getSharerId() {
        return sharerId;
    }

    public void setSharerId(Long sharerId) {
        this.sharerId = sharerId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getMallOrderNum() {
        return mallOrderNum;
    }

    public void setMallOrderNum(String mallOrderNum) {
        this.mallOrderNum = mallOrderNum;
    }

    public BigDecimal getSettleAmount() {
        return settleAmount;
    }

    public void setSettleAmount(BigDecimal settleAmount) {
        this.settleAmount = settleAmount;
    }

    public BigDecimal getServeFee() {
        return serveFee;
    }

    public void setServeFee(BigDecimal serveFee) {
        this.serveFee = serveFee;
    }

    public Long getSettleNum() {
        return settleNum;
    }

    public void setSettleNum(Long settleNum) {
        this.settleNum = settleNum;
    }

    public BigDecimal getResellFee() {
        return resellFee;
    }

    public void setResellFee(BigDecimal resellFee) {
        this.resellFee = resellFee;
    }

    public BigDecimal getSharerFee() {
        return sharerFee;
    }

    public void setSharerFee(BigDecimal sharerFee) {
        this.sharerFee = sharerFee;
    }

    public BigDecimal getBuyerFee() {
        return buyerFee;
    }

    public void setBuyerFee(BigDecimal buyerFee) {
        this.buyerFee = buyerFee;
    }

    public String getMerchantName() {
        return merchantName;
    }

    public void setMerchantName(String merchantName) {
        this.merchantName = merchantName;
    }

    public String getBuyerName() {
        return buyerName;
    }

    public void setBuyerName(String buyerName) {
        this.buyerName = buyerName;
    }

    public SettleOrderSource getOrderSource() {
        return orderSource;
    }

    public void setOrderSource(SettleOrderSource orderSource) {
        this.orderSource = orderSource;
    }

    public String getMerchantOrderNum() {
        return merchantOrderNum;
    }

    public void setMerchantOrderNum(String merchantOrderNum) {
        this.merchantOrderNum = merchantOrderNum;
    }

    public Long getFundFlowId() {
        return fundFlowId;
    }

    public void setFundFlowId(Long fundFlowId) {
        this.fundFlowId = fundFlowId;
    }
}
